{% extends 'generic/object_create.html' %}
{% load form_helpers %}
{% load helpers %}

{% block form %}
    <div class="card">
        <div class="card-header"><strong>Interface</strong></div>
        <div class="card-body">
            {% render_field form.virtual_machine %}
            {% render_field form.name %}
            {% render_field form.status %}
            {% render_field form.role %}
            {% render_field form.enabled %}
            {% render_field form.parent_interface %}
            {% render_field form.bridge %}
            {% render_field form.vrf %}
            {% render_field form.mac_address %}
            {% render_field form.ip_addresses %}
            {% render_field form.mtu %}
            {% render_field form.description %}
        </div>
    </div>
    <div class="card">
        <div class="card-header"><strong>802.1Q Switching</strong></div>
        <div class="card-body">
            {% render_field form.mode %}
            {% render_field form.untagged_vlan %}
            {% render_field form.tagged_vlans %}
        </div>
    </div>
    {% include 'inc/extras_features_edit_form_fields.html' %}
{% endblock %}


{% block buttons %}
    {% if editing %}
        <button type="submit" name="_update" class="btn btn-primary">
            <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
            -->Update
        </button>
        <button type="submit" formaction="?return_url={% url 'virtualization:vminterface_edit' pk=obj.pk %}" class="btn btn-primary">
            <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
            -->Update and Continue Editing
        </button>
    {% else %}
        <button type="submit" name="_create" class="btn btn-primary">
            <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
            -->Create
        </button>
        <button type="submit" name="_addanother" class="btn btn-primary">
            <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
            -->Create and Add Another
        </button>
    {% endif %}
    <a href="{{ return_url }}" class="btn btn-secondary">
        <span aria-hidden="true" class="mdi mdi-close me-4"></span><!--
        -->Cancel
    </a>
{% endblock %}
